package khl.ooo.db;

import java.io.*;
import khl.ooo.domain.cursus.CursusCollection;

public class CursusDb extends FileDb implements Serializable{
	public CursusDb()
	{
	}
	public void schrijfCursussen(CursusCollection c)
	{
	try{
		FileOutputStream curStream = new FileOutputStream("curs.ser");
		ObjectOutputStream cs = new ObjectOutputStream(curStream);
		cs.writeObject(c);
	}
	catch(Exception e){e.printStackTrace();}
	}
	
	public CursusCollection leesCursussen()
	{
	CursusCollection C=new CursusCollection();
	try{
		FileInputStream curStream = new FileInputStream("curs.ser");
		ObjectInputStream cs = new ObjectInputStream(curStream);
		Object uit = cs.readObject();
		C = (CursusCollection) uit;
	}
	catch(Exception e){e.printStackTrace();}
	return C;
	}
}
